package com.pft.web.view.contract;

import android.graphics.Rect;
import android.view.SurfaceHolder;

/**
 * QrCode契约类
 *
 * @author lijianqing
 */

public class QrCodeContract {

    public interface View {

        /**
         * @param formatMode 扫码的格式。如果是条形码返回{@link QrCodePresenterImp#FORMATS_FOR_MODE_1D}，如果是二维码返回{@link QrCodePresenterImp#FORMATS_FOR_MODE_2D}
         * @param result 扫码文本结果。
         */
        void displayScanResult(int formatMode, String result);

        void closePage();

        void openCameraError(Throwable t);
    }

    public interface Presenter {

        void openCamera();

        void setupCamera(int previewWidth, int previewHeight, Rect frameRect, SurfaceHolder holder);

        void startPreview();

        void stopPreview();

        void closeCamera();

        void flashOn();

        void flashOff();
    }
}
